from django.utils.deprecation import MiddlewareMixin


class AuthMiddleware1(MiddlewareMixin):
    def process_request(self, reqeust):
        print("process_request1()方法执行了")

    def process_view(self, request, callback, callback_args, callback_kwargs):
        print("process_view1()方法执行了")

    def process_template_response(self, request, response):
        print("process_template_response1()方法执行了")
        return response

    def process_exception(self, request,response,exception):
        print("process_exception1()方法执行了")
        return response
    def process_response(self,request,response):
        print("process_response1()方法执行了")
        return response


class AuthMiddleware2(MiddlewareMixin):
    def process_request(self, reqeust):
        print("process_request2()方法执行了")

    def process_view(self, request, callback, callback_args, callback_kwargs):
        print("process_view2()方法执行了")

    def process_template_response(self, request, response):
        print("process_template_response2()方法执行了")
        return response

    def process_exception(self,request,response,exception):
        print("process_exception2()方法执行了")
        return response

    def process_response(self,request,response):
        print("process_response2()方法执行了")
        return response